import {
  INCREMENTCOUNT,
  DECREMENTCOUNT
} from "../constant/contConst"
import store from "../store"
// 累加的action
export const incrementAction = (data) => {
  return {
    type: INCREMENTCOUNT,
    data
  }
}
// 累减的action
export const decrementAction = (data) => {
  return {
    type: DECREMENTCOUNT,
    data
  }
}

//异步action
export const waiIncrementAction = (data) => {
  return () => {
    setTimeout(() => {
      store.dispatch({
        type: INCREMENTCOUNT,
        data
      })
    }, 2000)
  }
}